{include file="public/meta" /}
<title>添加</title>
</head>
<body>
<article class="cl pd-20">
    <form class="form form-horizontal" id="form-express-edit">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>快递名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['title']}" placeholder="2-50个汉字组成" id="title" name="title">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">偏远地区：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                {foreach name="provinces" item="vo"}
                <div class="check-box">
                    <input type="checkbox" id="checkbox-pinglun{$vo['provinceid']}" name="provinces[]" value="{$vo['provinceid']}" {if condition="strpos($info['provinces_code'],$vo['provinceid'])"}checked{/if}>{$vo['province']}
                    <label for="checkbox-pinglun{$vo['provinceid']}">&nbsp;</label>
                </div>
                {/foreach}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>价格：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['money']}" placeholder="只能填写大于等于0的数字" id="money" name="money">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">是否启用：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                <div class="check-box">
                    <input type="checkbox" id="checkbox-status" name="status" value="0" {if condition="$info['status'] eq 0"} checked{/if}>启用
                    <label for="checkbox-status">&nbsp;</label>
                </div>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input type="hidden" name="id" value="{$info['id']}">
                <input class="btn btn-primary radius" type="button" id="form-express-submit" value="&nbsp;&nbsp;确认添加&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>

<!--_footer 作为公共模版分离出去-->
{include file="public/footer" /}
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
    });
    $("#form-express-submit").click(function () {
        var data = $("#form-express-edit").serializeArray();
        $.ajax({
            url:"{:url('System/editExpress')}",
            type:'post',
            data: data,
            dataType:'json',
            success:function(data){
                if(data.code==0)
                {
                    parent.layer.msg(data.msg,{icon:6,time:1000});
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.window.location.reload();
                    parent.layer.close(index);
                }
                else
                {
                    parent.layer.msg(data.msg,{icon:5,time:1000});
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
            },
            error:function(data){
                layer.msg('500系统错误，请联系管理员！',{icon:5,time:1000});
            }
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>